import Vue from 'vue'
import Router from 'vue-router'


Vue.use(Router)

const routes= [
  {
    path: '/home',
    meta: {id:'',icon: '', name: ''},
    // meta: {id:'home',icon: '', name: '主页'},
    redirect: '/main',
    // meta:{id:'home',icon: 'home', name: '首页',isAction:true},
    component:  () => import('../views/Home.vue'),
    children:[
      {
        path: '/main', name: 'main', meta: {id:'main',icon: 'home', name: '首页',isAction:true}, component: () => import('../views/main/Index')
      },
      {
        path: '/army', meta: {id:'army',icon: 'team', name: '人员管理',isAction:true}, component: () => import('../views/army/Index'),
        children: [
          {
            path: '', name: 'army', meta: {id:'team',icon: 'team', name: '人员管理',notBre:true}, component: () => import('../views/army/Army')
          }
        ]
      },
      {
        path: '/repair', name: 'repair', meta: {id:'repair',icon: 'tool', name: '维修管理',isAction:true}, component: () => import('../views/repair/Index'),
        children:[
          {
            path: '',
            meta: {id: 'examines', icon: 'flag', name: '维修', notBre: true},
            component: () => import('../views/repair/Repair'),
            children: [
              {
                path: '',
                name: 'repaired',
                meta: {id: 'repaired', icon: 'file-protect', name: '已维修'},
                component: () => import('../views/repair/Repaired')
              },
              {
                path: 'unRepair',
                name: 'unRepair',
                meta: {id: 'unRepair', icon: 'file-search', name: '待维修'},
                component: () => import('../views/repair/UnRepair')
              },
              {
                path: 'inRepair',
                name: 'inRepair',
                meta: {id: 'inRepair', icon: 'file-sync', name: '待审核'},
                component: () => import('../views/repair/InRepair')
              },
              {
                path: 'UnRepaired',
                name: 'UnRepaired',
                meta: {id: 'UnRepaired', icon: 'exception', name: '驳回'},
                component: () => import('../views/repair/UnRepaired')
              }
            ]
          },
          {
            path: '/repairDetails',
            name: 'repairDetails',
            meta: {id:'RepairDetails',icon: 'file-sync', name: '维修详情'},
            component: () => import('../views/repair/repairDetails/Index'),
            children: [
              {
                path: '',
                name: 'repairDetailsChild',
                meta: {id: 'repairDetailsChild', icon: 'file-protect', name: '已维修',notBre: true},
                component: () => import('../views/repair/repairDetails/RepairDetails')
              }]
          }
        ]
      },
      {
        path: '/material', name: 'material', meta: {id:'material',icon: 'printer', name: '材料管理',isAction:true}, component: () => import('../views/material/Index'),
        children: [
          {
            path: '', name: 'materials', meta: {id:'materials',icon: 'printer', name: '材料管理',notBre:true}, component: () => import('../views/material/Material')
          }
          ]
      },
      // {
      //   path: '/evauate', name: 'evauate', meta: {id:'evauate',icon: 'fund', name: '统计评估'}, component: () => import('../views/evauates/Index')
      // },
      {
        path: '/help', name: 'help', meta: {id:'question-circle',icon: 'question-circle', name: '帮助'}, component: () => import('../views/help/Help')
      },
    ]

  },
  {
    path: '/',
    name: 'login',
    meta:{id:'home',icon: 'home', name: '首页',isAction:true},
    component: () => import( '../views/Login.vue')
  },
]

export default new Router({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})
